/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package org.ridepad.model;

import java.io.Serializable;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author ananthaamornphong
 */
@Entity
@Table(name = "reqtrans")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Reqtrans.findAll", query = "SELECT r FROM Reqtrans r"),
    @NamedQuery(name = "Reqtrans.findById", query = "SELECT r FROM Reqtrans r WHERE r.id = :id"),
    @NamedQuery(name = "Reqtrans.findByEmail", query = "SELECT r FROM Reqtrans r WHERE r.email = :email"),
    @NamedQuery(name = "Reqtrans.findByState", query = "SELECT r FROM Reqtrans r WHERE r.state = :state"),
    @NamedQuery(name = "Reqtrans.findByParticipants", query = "SELECT r FROM Reqtrans r WHERE r.participants = :participants"),
    @NamedQuery(name = "Reqtrans.findByTimetx", query = "SELECT r FROM Reqtrans r WHERE r.timetx = :timetx")})
public class Reqtrans implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @NotNull
    @Column(name = "ID")
    private Integer id;
    // @Pattern(regexp="[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?", message="Invalid email")//if the field contains email address consider using this annotation to enforce field validation
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 100)
    @Column(name = "email")
    private String email;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 50)
    @Column(name = "state")
    private String state;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 100)
    @Column(name = "participants")
    private String participants;
    @Basic(optional = false)
    @NotNull
    @Column(name = "timetx")
    @Temporal(TemporalType.TIMESTAMP)
    private Date timetx;

    public Reqtrans() {
    }

    public Reqtrans(Integer id) {
        this.id = id;
    }

    public Reqtrans(Integer id, String email, String state, String participants, Date timetx) {
        this.id = id;
        this.email = email;
        this.state = state;
        this.participants = participants;
        this.timetx = timetx;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    public String getState() {
        return state;
    }

    public void setState(String state) {
        this.state = state;
    }

    public String getParticipants() {
        return participants;
    }

    public void setParticipants(String participants) {
        this.participants = participants;
    }

    public Date getTimetx() {
        return timetx;
    }

    public void setTimetx(Date timetx) {
        this.timetx = timetx;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (id != null ? id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Reqtrans)) {
            return false;
        }
        Reqtrans other = (Reqtrans) object;
        if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "org.ridepad.model.Reqtrans[ id=" + id + " ]";
    }
    
}
